home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / rocketbi.swf / scripts / frame_2 / DoAction_2.as next >
Encoding:
Text File  |  2011-03-26  |  24.4 KB  |  741 lines

  1. function newgame()
  2. {
  3.    msg.txt = "START!";
  4.    msg.gotoAndPlay(2);
  5.    fondo.slide.gotoAndStop(random(fondo.slide._totalframes) + 1);
  6.    if(temphuman != null)
  7.    {
  8.       bikers[human] = temphuman;
  9.       temphuman = null;
  10.    }
  11.    delete loop.onEnterFrame;
  12.    murder = false;
  13.    mafiamission = false;
  14.    sponsored = false;
  15.    minutes = seconds = milliseconds = 0;
  16.    n = 2;
  17.    while(n <= 1000)
  18.    {
  19.       removeMovieClip(obstacles[n]);
  20.       n++;
  21.    }
  22.    n = 1;
  23.    while(n <= 4)
  24.    {
  25.       removeMovieClip(bikes[n]);
  26.       n++;
  27.    }
  28.    liveplayers = muchbikes;
  29.    usejumper = paused = false;
  30.    obstacles._x = 245;
  31.    obstacles.attachMovie("obstacle",1,1);
  32.    obstacles[1].gotoAndStop("meta");
  33.    obstacles[1].kind = "meta";
  34.    arrived = 0;
  35.    heat.gotoAndStop(1);
  36.    n = 2;
  37.    while(n <= 10)
  38.    {
  39.       obstacles.attachMovie("obstacle",n,n);
  40.       obstacles[n].kind = obstaclekind[random(obstaclekind.length + 1)];
  41.       obstacles[n].gotoAndStop(obstacles[n].kind);
  42.       obstacles[n]._x = obstacles[Number(n - 1)]._x + obstacles[Number(n - 1)]._width + 150;
  43.       if(obstacles[n].kind == "jumper")
  44.       {
  45.          if(usejumper)
  46.          {
  47.             n--;
  48.          }
  49.          else
  50.          {
  51.             usejumper = true;
  52.          }
  53.       }
  54.       n++;
  55.    }
  56.    trackwidth = obstacles._width + 50;
  57.    laps = muchbikes * 2;
  58.    lap = (trackwidth + center * 2 + 10) * laps;
  59.    temp = new Array();
  60.    temp[bikers[human]] = true;
  61.    bars[human].gotoAndStop(bikers[human]);
  62.    n = 1;
  63.    while(n <= 4)
  64.    {
  65.       bars[n]._visible = false;
  66.       n++;
  67.    }
  68.    n = 1;
  69.    while(n <= muchbikes)
  70.    {
  71.       playerstate[n] = "alive";
  72.       xvel[n] = 0;
  73.       keyb[n] = true;
  74.       damage[n] = 0;
  75.       winnercounter[n] = 0;
  76.       kilometer[n] = 0;
  77.       bars[n]._visible = true;
  78.       bikes.attachMovie("biker",n,n);
  79.       bikes[n]._x = 310;
  80.       mode[n] = "ground";
  81.       mytrack[n] = eval("track" + n)._y;
  82.       bikes[n]._y = mytrack[n];
  83.       bars[n].light.dot.dot._xscale = bars[n].light.dot.dot._yscale = 100;
  84.       if(n != human)
  85.       {
  86.          engine[n] = engine[human] * 0.95 + Math.random(5) / 10 - muchplayers / 50;
  87.          m = 0;
  88.          while(m == 0)
  89.          {
  90.             newmodel = random(6) + 1;
  91.             if(!temp[newmodel])
  92.             {
  93.                temp[newmodel] = true;
  94.                m = 1;
  95.                bikers[n] = models[n] = newmodel;
  96.                bars[n].gotoAndStop(newmodel);
  97.                bars[n].light.dot.dot._xscale = bars[n].light.dot.dot._yscale = 80;
  98.                heat[n].model.gotoAndStop(newmodel);
  99.                cauchomodel[n] = 2;
  100.                xtra[n] = "fuel";
  101.                weaponcounter[n] = 1000;
  102.             }
  103.          }
  104.       }
  105.       n++;
  106.    }
  107.    xtraface.gotoAndStop(xtra[human]);
  108.    weaponface.gotoAndStop(weapon[human]);
  109.    engineface.gotoAndStop(motor);
  110.    cauchoface.gotoAndStop(caucho);
  111.    loop.onEnterFrame = function()
  112.    {
  113.       if(!paused)
  114.       {
  115.          milliseconds++;
  116.          if(milliseconds > 60)
  117.          {
  118.             milliseconds = 0;
  119.             seconds++;
  120.             if(seconds > 60)
  121.             {
  122.                seconds = 0;
  123.                minutes++;
  124.                if(minutes > 60)
  125.                {
  126.                   minutes = 0;
  127.                }
  128.             }
  129.          }
  130.          if(milliseconds < 10)
  131.          {
  132.             showmilliseconds = "0" + milliseconds;
  133.          }
  134.          else
  135.          {
  136.             showmilliseconds = milliseconds;
  137.          }
  138.          if(seconds < 10)
  139.          {
  140.             showseconds = "0" + seconds;
  141.          }
  142.          else
  143.          {
  144.             showseconds = seconds;
  145.          }
  146.          if(minutes < 10)
  147.          {
  148.             showminutes = "0" + minutes;
  149.          }
  150.          else
  151.          {
  152.             showminutes = minutes;
  153.          }
  154.          showtime = showminutes + ":" + showseconds + ":" + milliseconds;
  155.          if(keyb[human] != false)
  156.          {
  157.             if(key.isDown(39))
  158.             {
  159.                xvel[human] += engine[human];
  160.                bikes[human].gotoAndStop(1);
  161.                if(motorstarted == false)
  162.                {
  163.                   motorstarted = true;
  164.                   motorsnd.start(0,9999);
  165.                }
  166.             }
  167.             else if(key.isDown(37))
  168.             {
  169.                if(kilometer[human] > -10)
  170.                {
  171.                   xvel[human] -= engine[human];
  172.                   bikes[human].gotoAndStop(2);
  173.                   if(motorstarted == false)
  174.                   {
  175.                      motorstarted = true;
  176.                      motorsnd.start(0,9999);
  177.                   }
  178.                }
  179.             }
  180.             else
  181.             {
  182.                motorstarted = false;
  183.                motorsnd.stop();
  184.             }
  185.          }
  186.          xvel[human] *= friction;
  187.          if(mode[human] == "ground")
  188.          {
  189.             if(keyb[human] != false)
  190.             {
  191.                if(key.isDown(38))
  192.                {
  193.                   yvel[human] -= 0.9;
  194.                }
  195.                if(key.isDown(40))
  196.                {
  197.                   yvel[human] += 0.9;
  198.                }
  199.             }
  200.             yvel[human] *= friction * friction;
  201.             bikes[human]._y += yvel[human];
  202.             if(bikes[human]._y < track1._y)
  203.             {
  204.                bikes[human]._y = track1._y;
  205.                yvel[human] = 0;
  206.             }
  207.             if(bikes[human]._y > track4._y)
  208.             {
  209.                bikes[human]._y = track4._y;
  210.                yvel[human] = 0;
  211.             }
  212.          }
  213.          obstacles._x -= xvel[human];
  214.          back._x -= xvel[human] / 35;
  215.          fondo.slide.clouds._x -= xvel[human] / 25;
  216.          if(xvel[human] > 0 and bikes[human]._x > leftcenter or xvel[human] < 0 and bikes[human]._x < rightcenter)
  217.          {
  218.             bikes[human]._x -= xvel[human] / 2;
  219.          }
  220.          if(xvel[human] < 0)
  221.          {
  222.             if(obstacles._x > center * 2)
  223.             {
  224.                obstacles._x = - trackwidth;
  225.             }
  226.             if(back._x > center)
  227.             {
  228.                back._x -= back._width / 3;
  229.             }
  230.             if(fondo.slide.clouds._x > center)
  231.             {
  232.                fondo.slide.clouds._x -= fondo.slide.clouds._width / 3;
  233.             }
  234.          }
  235.          else
  236.          {
  237.             if(obstacles._x < - trackwidth)
  238.             {
  239.                obstacles._x = center * 2 + 10;
  240.             }
  241.             if(back._x < center)
  242.             {
  243.                back._x += back._width / 3;
  244.             }
  245.             if(fondo.slide.clouds._x < center)
  246.             {
  247.                fondo.slide.clouds._x += fondo.slide.clouds._width / 3;
  248.             }
  249.          }
  250.          if(seconds > 14 and sponsored == false and muchbikes > 2 and damage[human] < 80)
  251.          {
  252.             paused = sponsored = true;
  253.             mafia.gotoAndPlay(2);
  254.          }
  255.          healingcounter++;
  256.          if(healingcounter >= 15)
  257.          {
  258.             healingcounter = 0;
  259.             b = 1;
  260.             while(b <= muchbikes)
  261.             {
  262.                if(damage[b] > 1 and damage[b] < 100)
  263.                {
  264.                   damagebike(b,-0.8);
  265.                }
  266.                if(b != human and mode[b] == "ground")
  267.                {
  268.                   temp = random(20);
  269.                   if(temp == 0)
  270.                   {
  271.                      weapon[b] = weaponitems[random(4) + 1];
  272.                      useweapon(b);
  273.                   }
  274.                   else if(temp <= 2 and damage[b] < 40)
  275.                   {
  276.                      usextra(b);
  277.                   }
  278.                }
  279.                b++;
  280.             }
  281.          }
  282.          b = 1;
  283.          while(b <= muchbikes)
  284.          {
  285.             bikes[b].swapDepths(bikes[b]._y);
  286.             bars[b].swapDepths(100 - kilpercent[b]);
  287.             kilometer[b] += xvel[b];
  288.             kilpercent[b] = Math.ceil(kilometer[b] * 100 / lap);
  289.             bars[b].light.gotoAndStop(kilpercent[b]);
  290.             if(bikes[b]._x > obstacles._x and kilpercent[b] > 100 and winnercounter[b] < 1)
  291.             {
  292.                bikes[b].chase.b.gotoAndStop("trick");
  293.                winnercounter[b] = 1;
  294.                keyb[b] = false;
  295.             }
  296.             if(b != human)
  297.             {
  298.                if(keyb[b] != false)
  299.                {
  300.                   xvel[b] += engine[b];
  301.                }
  302.                xvel[b] *= friction;
  303.                bikes[b]._x += xvel[b] - xvel[human];
  304.                if(bikes[b]._x + obstacles._x > trackwidth + obstacles._x)
  305.                {
  306.                   bikes[b]._x -= trackwidth;
  307.                }
  308.                if(bikes[b]._x < -100)
  309.                {
  310.                   bikes[b]._x += trackwidth;
  311.                }
  312.                if(mode[b] == "ground" and keyb[b] != false)
  313.                {
  314.                   if(random(60) == 0 and mytrackcounter[b] < 1)
  315.                   {
  316.                      mytrackcounter[b] = 1;
  317.                      mytrack[b] = eval("track" + Number(random(4) + 1))._y;
  318.                   }
  319.                   else if(mytrackcounter[b] > 0)
  320.                   {
  321.                      mytrackcounter[b]++;
  322.                      bikes[b]._y += (mytrack[b] - bikes[b]._y) / 20;
  323.                      if(mytrackcounter[b] > 20)
  324.                      {
  325.                         mytrackcounter[b] = 0;
  326.                      }
  327.                   }
  328.                }
  329.             }
  330.             if(mode[b] == "falling")
  331.             {
  332.                if(b == human)
  333.                {
  334.                   motorstarted = false;
  335.                   motorsnd.stop();
  336.                }
  337.                bikes[b]._y += yvel[b];
  338.                yvel[b] += gravity;
  339.                bikes[b].chase.b._rotation += Math.abs(xvel[b] / 30);
  340.                if(bikes[b]._y > mytrack[b])
  341.                {
  342.                   bikes[b].chase.b._rotation = 0;
  343.                   bikes[b]._y = mytrack[b];
  344.                   if(yvel[b] > 7)
  345.                   {
  346.                      bikes[b].chase.b.gotoAndPlay(1);
  347.                      yvel[b] = (- yvel[b]) * bounce;
  348.                   }
  349.                   else
  350.                   {
  351.                      mode[b] = "ground";
  352.                      yvel[b] = 0;
  353.                   }
  354.                }
  355.             }
  356.             if(winnercounter[b] > 0)
  357.             {
  358.                if(mafiamission == b)
  359.                {
  360.                   murdered();
  361.                }
  362.                if(b == human)
  363.                {
  364.                   if(winnercounter[b] == 3)
  365.                   {
  366.                      playsound("newplayer");
  367.                   }
  368.                   if(mafiamission != false and mafiamission != "served")
  369.                   {
  370.                      murdered();
  371.                   }
  372.                   _xscale = _yscale = _yscale + (160 - _yscale) / 10;
  373.                   _Y = _Y + (-90 - _Y) / 10;
  374.                   _X = _X + (-100 - _X) / 10;
  375.                }
  376.                bars[b]._visible = false;
  377.                bikes[b]._alpha -= 2;
  378.                winnercounter[b]++;
  379.                if(winnercounter[b] == 50)
  380.                {
  381.                   arrived++;
  382.                   winner[arrived] = b;
  383.                   winnertime[arrived] = showtime;
  384.                   removeMovieClip(bikes[b]);
  385.                   playerstate[b] = "winner";
  386.                   mode[b] = "winner";
  387.                   if(arrived >= liveplayers or arrived >= 3 or b == human)
  388.                   {
  389.                      forcewinners();
  390.                   }
  391.                }
  392.             }
  393.             else if(explodecounter[b] > 0)
  394.             {
  395.                keyb[b] = false;
  396.                explodecounter[b]++;
  397.                if(b == human)
  398.                {
  399.                   motorsnd.stop();
  400.                   _xscale = _yscale = _yscale + (160 - _yscale) / 10;
  401.                   _Y = _Y + (-90 - _Y) / 10;
  402.                   _X = _X + (-100 - _X) / 10;
  403.                }
  404.                if(explodecounter[b] < 42)
  405.                {
  406.                   bars[b]._visible = false;
  407.                   bikes[b].chase.b.explode.play();
  408.                   bikes[b].chase.b.gotoAndStop("trick");
  409.                }
  410.                else
  411.                {
  412.                   if(b == human)
  413.                   {
  414.                      xtraface.gotoAndStop(1);
  415.                      weaponface.gotoAndStop(1);
  416.                      engineface.gotoAndStop(1);
  417.                      cauchoface.gotoAndStop(1);
  418.                   }
  419.                   bikes[b].chase.b.gotoAndStop("explode");
  420.                   if(explodecounter[b] == 150)
  421.                   {
  422.                      if(mafiamission == b)
  423.                      {
  424.                         mafiamission = "served";
  425.                         changemoney(mafiareward);
  426.                         paused = true;
  427.                         mafia.gotoAndPlay(2);
  428.                      }
  429.                      if(b == human and mafiamission != false and mafiamission != "served")
  430.                      {
  431.                         murdered();
  432.                      }
  433.                   }
  434.                   if(explodecounter[b] > 190)
  435.                   {
  436.                      playerstate[b] = "exploited";
  437.                      kilometer[b] = 0;
  438.                      liveplayers--;
  439.                      bikes[b]._visible = false;
  440.                      explodecounter[b] = kilometer[b] = 0;
  441.                      if(b == human)
  442.                      {
  443.                         xtra[human] = weapon[human] = null;
  444.                         cauchomodel[human] = engine[human] = 1;
  445.                         motor = "motor1";
  446.                         caucho = "caucho1";
  447.                         screen = "winners";
  448.                         forcewinners();
  449.                      }
  450.                      if(liveplayers <= 1)
  451.                      {
  452.                         forcewinners();
  453.                      }
  454.                   }
  455.                }
  456.             }
  457.             else if(rampcounter[b] > 0)
  458.             {
  459.                rampcounter[b]++;
  460.                if(xvel[b] > 0)
  461.                {
  462.                   xvel[b] += 0.5;
  463.                }
  464.                else
  465.                {
  466.                   xvel[b] -= 0.5;
  467.                }
  468.                if(rampcounter[b] > 45)
  469.                {
  470.                   rampcounter[b] = 0;
  471.                   keyb[b] = true;
  472.                }
  473.             }
  474.             else if(oilcounter[b] > 0)
  475.             {
  476.                if(b == human)
  477.                {
  478.                   motorsnd.stop();
  479.                }
  480.                keyb[b] = false;
  481.                rotatecounter[b]++;
  482.                if(rotatecounter[b] > 2)
  483.                {
  484.                   rotatecounter[b] = 0;
  485.                   if(bikes[b]._currentframe == 1)
  486.                   {
  487.                      bikes[b].gotoAndStop(2);
  488.                   }
  489.                   else
  490.                   {
  491.                      bikes[b].gotoAndStop(1);
  492.                   }
  493.                }
  494.                oilcounter[b]++;
  495.                if(oilcounter[b] > 10)
  496.                {
  497.                   oilcounter[b] = 0;
  498.                   ongroundcounter[b] = 1;
  499.                }
  500.             }
  501.             else if(tachuelascounter[b] > 0)
  502.             {
  503.                if(b == human)
  504.                {
  505.                   motorsnd.stop();
  506.                }
  507.                tachuelascounter[b]++;
  508.                bikes[b].chase.b._rotation -= Math.abs(xvel[b] * 4);
  509.                bikes[b].chase.b.gotoAndStop("trick");
  510.                if(tachuelascounter[b] > 42)
  511.                {
  512.                   bikes[b]._rotation = 0;
  513.                   tachuelascounter[b] = 0;
  514.                   ongroundcounter[b] = 1;
  515.                }
  516.             }
  517.             else if(gumcounter[b] > 0)
  518.             {
  519.                bikes[b]._x += xvel[b];
  520.                gumcounter[b]++;
  521.                yvel[b] -= 0.2;
  522.                bikes[b]._y += yvel[b];
  523.                bikes[b].chase.b.gotoAndStop("gum");
  524.                if(bikes[b]._x < gumcenter[b])
  525.                {
  526.                   xvel[b] += 0.5;
  527.                }
  528.                else
  529.                {
  530.                   xvel[b] -= 0.5;
  531.                }
  532.                bikes[b]._x += xvel[b];
  533.                if(gumcounter[b] > 140)
  534.                {
  535.                   gumcounter[b] = 0;
  536.                   yvel[b] = 0;
  537.                   bikes[b]._y = mytrack[b] - 80;
  538.                   mode[b] = "falling";
  539.                   bikes[b].chase.b.gotoAndPlay(1);
  540.                   bikes[b].stars.gotoAndPlay(2);
  541.                   keyb[b] = true;
  542.                   damagebike(b,20);
  543.                }
  544.             }
  545.             else if(ongroundcounter[b] > 0)
  546.             {
  547.                if(b == human)
  548.                {
  549.                   motorsnd.stop();
  550.                }
  551.                keyb[b] = false;
  552.                bikes[b].chase.b.gotoAndStop("onground");
  553.                ongroundcounter[b]++;
  554.                if(ongroundcounter[b] > 60)
  555.                {
  556.                   mytrack[b] = bikes[b]._y;
  557.                   bikes[b]._y -= 80;
  558.                   mode[b] = "falling";
  559.                   bikes[b].chase.b.gotoAndPlay(1);
  560.                   bikes[b].stars.gotoAndPlay(2);
  561.                   ongroundcounter[b] = 0;
  562.                }
  563.             }
  564.             else if(poisoncounter[b] > 0)
  565.             {
  566.                poisoncounter[b]++;
  567.                bikes[b].chase.b._rotation -= Math.abs(xvel[b] * 4);
  568.                bikes[b].chase.b.gotoAndStop("trick");
  569.                if(poisoncounter[b] > 62)
  570.                {
  571.                   bikes[b]._rotation = 0;
  572.                   poisoncounter[b] = 0;
  573.                   ongroundcounter[b] = 1;
  574.                }
  575.             }
  576.             o = 1;
  577.             while(o <= muchbikes)
  578.             {
  579.                if(bikes[b]._x > -10)
  580.                {
  581.                   if(bikes[b].chase.b.front.hitTest(bikes[o].chase.b.back))
  582.                   {
  583.                      damagebike(b,5);
  584.                      oilcounter[b]++;
  585.                      keyb[b] = false;
  586.                   }
  587.                }
  588.                o++;
  589.             }
  590.             o = 1;
  591.             while(o <= tracklength)
  592.             {
  593.                obspos = obstacles[o]._x + obstacles._x;
  594.                if(obspos < -300 or obspos > 700)
  595.                {
  596.                   if(obstacles[o]._x < 0 or obstacles[o]._x > trackwidth)
  597.                   {
  598.                      obstacles[o].kind = "blank";
  599.                   }
  600.                   obstacles[o].gotoAndStop("blank");
  601.                }
  602.                else
  603.                {
  604.                   kind = obstacles[o].kind;
  605.                   obstacles[o].gotoAndStop(kind);
  606.                   if(bikes[b]._x > -10)
  607.                   {
  608.                      if(mode[b] == "ground" and bikes[b].chase.b.front.hitTest(obstacles[o]))
  609.                      {
  610.                         obstacles[o][kind].snd.play();
  611.                         if(kind == "ramp")
  612.                         {
  613.                            mytrack[b] = bikes[b]._y;
  614.                            rampcounter[b]++;
  615.                            yvel[b] = -17;
  616.                            bikes[b]._y += yvel[b];
  617.                            bikes[b].chase.b._rotation = 325;
  618.                            bikes[b].chase.b.gotoAndStop("trick");
  619.                            mode[b] = "falling";
  620.                         }
  621.                         else if(kind == "jumper")
  622.                         {
  623.                            mytrack[b] = bikes[b]._y;
  624.                            rampcounter[b]++;
  625.                            xvel[b] *= 3;
  626.                            yvel[b] = -20;
  627.                            bikes[b]._y += yvel[b];
  628.                            bikes[b].chase.b._rotation = 325;
  629.                            bikes[b].chase.b.gotoAndStop("trick");
  630.                            mode[b] = "falling";
  631.                         }
  632.                         else if(kind == "dumb")
  633.                         {
  634.                            mytrack[b] = bikes[b]._y;
  635.                            xvel[b] *= 0.3;
  636.                            yvel[b] = -2;
  637.                            bikes[b].chase.b._rotation = random(10) - 5;
  638.                            mode[b] = "falling";
  639.                         }
  640.                         else if(kind == "grass")
  641.                         {
  642.                            xvel[b] *= 0.3;
  643.                            yvel[b] *= 0.1;
  644.                         }
  645.                         else if(kind == "oil")
  646.                         {
  647.                            obstacles[o][kind].play();
  648.                            damagebike(b,1);
  649.                            xvel[b] *= 1.1;
  650.                            oilcounter[b] = 1;
  651.                            keyb[b] = false;
  652.                         }
  653.                         else if(kind == "star")
  654.                         {
  655.                            if(bikes[b].chase.b.front.hitTest(obstacles[o].starbox.staranim.shadow))
  656.                            {
  657.                               obstacles[o].starbox.play();
  658.                               if(b == human and muchbikes > 1)
  659.                               {
  660.                                  changemoney(10);
  661.                               }
  662.                            }
  663.                         }
  664.                         else if(kind == "banana")
  665.                         {
  666.                            damagebike(b,15);
  667.                            obstacles[o].kind = "blank";
  668.                            obstacles[o].banana.play();
  669.                            xvel[b] *= 1.1;
  670.                            oilcounter[b] = 1;
  671.                            keyb[b] = false;
  672.                            if(obstacles[o].human == true and b != human)
  673.                            {
  674.                               trace(b + " " + human);
  675.                               obstacles[o].human = false;
  676.                               changemoney(5);
  677.                            }
  678.                         }
  679.                         else if(kind == "poison")
  680.                         {
  681.                            if(bikes[b].chase.b.front.hitTest(obstacles[o].poison.box))
  682.                            {
  683.                               damagebike(b,40);
  684.                               mytrack[b] = bikes[b]._y;
  685.                               xvel[b] *= -15;
  686.                               yvel[b] = -20;
  687.                               poisoncounter[b] = 1;
  688.                               bikes[b].chase.b.desinfla.play();
  689.                               mode[b] = "falling";
  690.                               keyb[b] = false;
  691.                               obstacles[o].poison.play(2);
  692.                               if(obstacles[o].human == true and n != human)
  693.                               {
  694.                                  obstacles[o].human = false;
  695.                                  changemoney(20);
  696.                               }
  697.                            }
  698.                         }
  699.                         else if(kind == "gum")
  700.                         {
  701.                            obstacles[o].gum.play();
  702.                            mytrack[b] = bikes[b]._y;
  703.                            gumcenter[b] = bikes[b]._x - xvel[b] * 2;
  704.                            xvel[b] *= 0.3;
  705.                            gumcounter[b] = 1;
  706.                            keyb[b] = false;
  707.                            mode[b] = "gum";
  708.                            if(obstacles[o].human == true and n != human)
  709.                            {
  710.                               obstacles[o].human = false;
  711.                               changemoney(15);
  712.                            }
  713.                         }
  714.                         else if(kind == "tachuelas")
  715.                         {
  716.                            obstacles[o].tachuelas.play();
  717.                            damagebike(b,20);
  718.                            mytrack[b] = bikes[b]._y;
  719.                            xvel[b] *= -2;
  720.                            yvel[b] = -15;
  721.                            tachuelascounter[b] = 1;
  722.                            bikes[b].chase.b.desinfla.play();
  723.                            mode[b] = "falling";
  724.                            keyb[b] = false;
  725.                            if(obstacles[o].human == true and n != human)
  726.                            {
  727.                               obstacles[o].human = false;
  728.                               changemoney(10);
  729.                            }
  730.                         }
  731.                      }
  732.                   }
  733.                }
  734.                o++;
  735.             }
  736.             b++;
  737.          }
  738.       }
  739.    };
  740. }
  741.